﻿-- =============================================
-- Author:		Andreas Könighofer (IT-eXperience)
-- Create date: 14.01.2009
-- Description:	Inserts new resource into resourcetable
-- =============================================
CREATE PROCEDURE [dbo].[CreateResource] 
	-- Add the parameters for the stored procedure here
	@LocationID SMALLINT,
	@RessourceName NVARCHAR(100),
	@SSNo NVARCHAR(50) = NULL,
	@MachineTypeID SMALLINT = NULL,
	@Status NVARCHAR(50) = NULL,
	@SerialNo NVARCHAR(50) = NULL
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

    -- Insert statements for procedure here
	INSERT BigDays2009.dbo.Resource
	(
		LocationID,
		RessourceName,
		SSNo,
		MachineTypeID,
		Status,
		SerialNo
	)
	VALUES
	(
		@LocationID,
		@RessourceName,
		@SSNo,
		@MachineTypeID,
		@Status,
		@SerialNo
	)
	
	RETURN SCOPE_IDENTITY()
END

---- end script CreateResource stored procedure ----

---- start script CreateMachine stored procedure ----

